package cn.gson.springboot.model.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the drug_purchase_yk database table.
 * 
 */
@Entity
@Table(name="drug_purchase_yk")
@NamedQuery(name="DrugPurchaseYk.findAll", query="SELECT d FROM DrugPurchaseYk d")
public class DrugPurchaseYk implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="purchase_id")
	private int purchaseId;

	@Column(name="purchase_amount_of_cg")
	private BigDecimal purchaseAmountOfCg;

	@Column(name="purchase_batch_number_cg")
	private String purchaseBatchNumberCg;

	@Column(name="purchase_people")
	private String purchasePeople;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="purchase_time")
	private Date purchaseTime;

	@Column(name="purchase_total_number")
	private int purchaseTotalNumber;
	
	@Column(name="purchase_static")
	private String purchaseStatic;

	//bi-directional many-to-one association to PurchaseDetailsYk
	@OneToMany(mappedBy="drugPurchaseYk")
	private List<PurchaseDetailsYk> purchaseDetailsYks;

	//bi-directional many-to-one association to WarehousingAuditYk
	@OneToMany(mappedBy="drugPurchaseYk")
	private List<WarehousingAuditYk> warehousingAuditYks;

	public DrugPurchaseYk() {
	}

	public int getPurchaseId() {
		return this.purchaseId;
	}

	public void setPurchaseId(int purchaseId) {
		this.purchaseId = purchaseId;
	}

	public BigDecimal getPurchaseAmountOfCg() {
		return this.purchaseAmountOfCg;
	}

	public void setPurchaseAmountOfCg(BigDecimal purchaseAmountOfCg) {
		this.purchaseAmountOfCg = purchaseAmountOfCg;
	}

	public String getPurchaseBatchNumberCg() {
		return this.purchaseBatchNumberCg;
	}

	public void setPurchaseBatchNumberCg(String purchaseBatchNumberCg) {
		this.purchaseBatchNumberCg = purchaseBatchNumberCg;
	}

	public String getPurchasePeople() {
		return this.purchasePeople;
	}

	public void setPurchasePeople(String purchasePeople) {
		this.purchasePeople = purchasePeople;
	}

	public String getPurchaseStatic() {
		return purchaseStatic;
	}

	public void setPurchaseStatic(String purchaseStatic) {
		this.purchaseStatic = purchaseStatic;
	}

	public Date getPurchaseTime() {
		return this.purchaseTime;
	}

	public void setPurchaseTime(Date purchaseTime) {
		this.purchaseTime = purchaseTime;
	}

	public int getPurchaseTotalNumber() {
		return this.purchaseTotalNumber;
	}

	public void setPurchaseTotalNumber(int purchaseTotalNumber) {
		this.purchaseTotalNumber = purchaseTotalNumber;
	}

	public List<PurchaseDetailsYk> getPurchaseDetailsYks() {
		return this.purchaseDetailsYks;
	}

	public void setPurchaseDetailsYks(List<PurchaseDetailsYk> purchaseDetailsYks) {
		this.purchaseDetailsYks = purchaseDetailsYks;
	}

	public PurchaseDetailsYk addPurchaseDetailsYk(PurchaseDetailsYk purchaseDetailsYk) {
		getPurchaseDetailsYks().add(purchaseDetailsYk);
		purchaseDetailsYk.setDrugPurchaseYk(this);

		return purchaseDetailsYk;
	}

	public PurchaseDetailsYk removePurchaseDetailsYk(PurchaseDetailsYk purchaseDetailsYk) {
		getPurchaseDetailsYks().remove(purchaseDetailsYk);
		purchaseDetailsYk.setDrugPurchaseYk(null);

		return purchaseDetailsYk;
	}

	public List<WarehousingAuditYk> getWarehousingAuditYks() {
		return this.warehousingAuditYks;
	}

	public void setWarehousingAuditYks(List<WarehousingAuditYk> warehousingAuditYks) {
		this.warehousingAuditYks = warehousingAuditYks;
	}

	public WarehousingAuditYk addWarehousingAuditYk(WarehousingAuditYk warehousingAuditYk) {
		getWarehousingAuditYks().add(warehousingAuditYk);
		warehousingAuditYk.setDrugPurchaseYk(this);

		return warehousingAuditYk;
	}

	public WarehousingAuditYk removeWarehousingAuditYk(WarehousingAuditYk warehousingAuditYk) {
		getWarehousingAuditYks().remove(warehousingAuditYk);
		warehousingAuditYk.setDrugPurchaseYk(null);

		return warehousingAuditYk;
	}

}